function data = pathology_init_data(data_name)
root = 'C:/Users/wang-lab/Desktop/pathology/data/';
%% generate regular expression from input
% data_name must always be of two elements, both alphanumeric:
% folder (nick)name, SPACE, then the element (nick)name (probably a number)
% e.g. for element 12 in folder "pos" and element 12, we enter "pos 12"
expr = '\w*\S';
[startindex, endindex] = regexp(data_name,expr);
folder = data_name(startindex(1):endindex(1));
element = data_name(startindex(2):endindex(2));
%% certain magic parameters
scanscope_roughness_th = 6;
microscope_roughness_th = 18;
scanscope_solidity_th = 0.6;
microscope_solidity_th = 0.2; % this should be lower than scanscope solidity, since the resolution is bettere

%% switch acts only on the folder level
switch folder,
    case 'pos',
        data.path = strcat(root,'0622/fungi/Pos Controls/');
        data.intensity_th = 170;
        data.min_area = 900;
        data.roughness_th = microscope_roughness_th; 
        data.eccentricity_th = 0.97; % max
        data.solidity_th = microscope_solidity_th;
        data.type = 'Microscope';
        if(length(element) == 1)
            data.file = ['Pos control ', '0', element, '.tif'];
        else
            data.file = ['Pos control ', element, '.tif'];
        end;
    case 'neg',
        data.path = strcat(root,'0622/fungi/Negative/');
        data.intensity_th = 170;
        data.min_area = 900;
        data.roughness_th = microscope_roughness_th; 
        data.eccentricity_th = 0.97; % max
        data.solidity_th = microscope_solidity_th;
        data.type = 'Microscope';
        if(length(element) == 1)
            data.file = ['S14-2402-0', element, '.tif'];
        else
            data.file = ['S14-2402-', element, '.tif'];
        end;
    case {'scanpos', '0109_pos'},
        data.path = strcat(root,'0109_2015/positive_tile/');
        data.intensity_th = 170;
        data.min_area = 100;
        data.roughness_th = scanscope_roughness_th; 
        data.eccentricity_th = 0.97; % max
        data.solidity_th = scanscope_solidity_th;
        data.type = 'Scanscope';
        data.file = ['cp_pos_crop', element, '.png'];
    case {'scanneg', '0109_neg'},
        data.path = strcat(root,'0109_2015/negative_tile/');
        data.intensity_th = 170;
        data.min_area = 100;
        data.roughness_th = scanscope_roughness_th;
        data.eccentricity_th = 0.97; % max
        data.solidity_th = scanscope_solidity_th;
        data.type = 'Scanscope';
        data.file = ['cp_neg_crop', element, '.png'];  
end;
%         
% switch data_name,
%     case 'pos1',
%         data.path = strcat(root,'0622/fungi/Pos Controls/');
%         data.file = 'Pos control 01.tif';
%         data.intensity_th = 100;
%         data.min_area = 500;
%     case 'pos2',
%         data.path = strcat(root,'0622/fungi/Pos Controls/');
%         data.file = 'Pos control 02.tif';
%         data.intensity_th = 100;
%         data.min_area = 500;
%     case 'pos3',
%         data.path = strcat(root,'0622/fungi/Pos Controls/');
%         data.file = 'Pos control 03.tif';
%         data.intensity_th = 100;
%         data.min_area = 500;
%     case 'pos4',
%         data.path = strcat(root,'0622/fungi/Pos Controls/');
%         data.file = 'Pos control 04.tif';
%         data.intensity_th = 100;
%         data.min_area = 500;
%     case 'pos5',
%         data.path = strcat(root,'0622/fungi/Pos Controls/');
%         data.file = 'Pos control 05.tif';
%         data.intensity_th = 100;
%         data.min_area = 500;
%     case 'pos6',
%         data.path = strcat(root,'0622/fungi/Pos Controls/');
%         data.file = 'Pos control 06.tif';
%         data.intensity_th = 100;
%         data.min_area = 500;
%     case 'pos7',
%         data.path = strcat(root,'0622/fungi/Pos Controls/');
%         data.file = 'Pos control 07.tif';
%         data.intensity_th = 100;
%         data.min_area = 500;
%     case 'pos8',
%         data.path = strcat(root,'0622/fungi/Pos Controls/');
%         data.file = 'Pos control 08.tif';
%         data.intensity_th = 100;
%         data.min_area = 500;
%     case 'pos9',
%         data.path = strcat(root,'0622/fungi/Pos Controls/');
%         data.file = 'Pos control 09.tif';
%         data.intensity_th = 100;
%         data.min_area = 500;
%     case 'pos10',
%         data.path = strcat(root,'0622/fungi/Pos Controls/');
%         data.file = 'Pos control 10.tif';
%         data.intensity_th = 100;
%         data.min_area = 500;
%     case 'pos11',
%         data.path = strcat(root,'0622/fungi/Pos Controls/');
%         data.file = 'Pos control 11.tif';
%         data.intensity_th = 100;
%         data.min_area = 500;
%     case 'pos12',
%         data.path = strcat(root,'0622/fungi/Pos Controls/');
%         data.file = 'Pos control 12.tif';
%         data.intensity_th = 100;
%         data.min_area = 500;
%     case 'pos13',
%         data.path = strcat(root,'0622/fungi/Pos Controls/');
%         data.file = 'Pos control 13.tif';
%         data.intensity_th = 100;
%         data.min_area = 500;
%     case 'neg1',
%         data.path = strcat(root,'0622/fungi/Negative/');
%         data.file = 'S14-2402-01.tif';
%         data.intensity_th = 100;
%         data.min_area = 500;
%     case 'neg2',
%         data.path = strcat(root,'0622/fungi/Negative/');
%         data.file = 'S14-2402-02.tif';
%         data.intensity_th = 100;
%         data.min_area = 500;
%     case 'neg3',
%         data.path = strcat(root,'0622/fungi/Negative/');
%         data.file = 'S14-2402-03.tif';
%         data.intensity_th = 100;
%         data.min_area = 500;
%     case 'neg4',
%         data.path = strcat(root,'0622/fungi/Negative/');
%         data.file = 'S14-2402-04.tif';
%         data.intensity_th = 100;
%         data.min_area = 500;
%     case 'neg5',
%         data.path = strcat(root,'0622/fungi/Negative/');
%         data.file = 'S14-2402-05.tif';
%         data.intensity_th = 100;
%         data.min_area = 500;
%     case 'neg6',
%         data.path = strcat(root,'0622/fungi/Negative/');
%         data.file = 'S14-2402-06.tif';
%         data.intensity_th = 100;
%         data.min_area = 500;
%     case 'neg7',
%         data.path = strcat(root,'0622/fungi/Negative/');
%         data.file = 'S14-2402-07.tif';
%         data.intensity_th = 100;
%         data.min_area = 500;
%     case 'neg8',
%         data.path = strcat(root,'0622/fungi/Negative/');
%         data.file = 'S14-2402-08.tif';
%         data.intensity_th = 100;
%         data.min_area = 500;
%     case 'neg9',
%         data.path = strcat(root,'0622/fungi/Negative/');
%         data.file = 'S14-2402-09.tif';
%         data.intensity_th = 100;
%         data.min_area = 500;
%     case 'neg10',
%         data.path = strcat(root,'0622/fungi/Negative/');
%         data.file = 'S14-2402-10.tif';
%         data.intensity_th = 100;
%         data.min_area = 500;
%     case 'neg11',
%         data.path = strcat(root,'0622/fungi/Negative/');
%         data.file = 'S14-2402-11.tif';
%         data.intensity_th = 100;
%         data.min_area = 500;
%     case 'neg12',
%         data.path = strcat(root,'0622/fungi/Negative/');
%         data.file = 'S14-2402-12.tif';
%         data.intensity_th = 100;
%         data.min_area = 500;
%     case 'neg13',
%         data.path = strcat(root,'0622/fungi/Negative/');
%         data.file = 'S14-2402-13.tif';
%         data.intensity_th = 100;
%         data.min_area = 500;
%     case 'neg14',
%         data.path = strcat(root,'0622/fungi/Negative/');
%         data.file = 'S14-2402-14.tif';
%         data.intensity_th = 100;
%         data.min_area = 500;
%     case 'neg15',
%         data.path = strcat(root,'0622/fungi/Negative/');
%         data.file = 'S14-2402-15.tif';
%         data.intensity_th = 100;
%         data.min_area = 500;
%     case 'neg16',
%         data.path = strcat(root,'0622/fungi/Negative/');
%         data.file = 'S14-2402-16.tif';
%         data.intensity_th = 100;
%         data.min_area = 500;
%     case 'neg17',
%         data.path = strcat(root,'0622/fungi/Negative/');
%         data.file = 'S14-2402-17.tif';
%         data.intensity_th = 100;
%         data.min_area = 500;
%     case 'neg18',
%         data.path = strcat(root,'0622/fungi/Negative/');
%         data.file = 'S14-2402-18.tif';
%         data.intensity_th = 100;
%         data.min_area = 500;
%     case 'neg19',
%         data.path = strcat(root,'0622/fungi/Negative/');
%         data.file = 'S14-2402-19.tif';
%     case 'neg20',
%         data.intensity_th = 100;
%         data.min_area = 500;
%         data.path = strcat(root,'0622/fungi/Negative/');
%         data.file = 'S14-2402-20.tif';
%     case '0109_pos85',
%         data.intensity_th = 170;
%         data.min_area = 100;
%         data.path = strcat(root,'0109_2015/positive_tile/');
%         data.file = 'cp_pos_crop1.png';
%         data.index = (1:150)'; %regexprep(file, 'crop1','crop100'), batch_fungi_detect()
%         also need to remove the regions>= 10*min_area
%     case '0109_neg42',
%         data.path = strcat(root,'0109_2015/negative_tile/');
%         data.file = 'cp_neg_crop42.png';
%         data.intensity_th = 170;
%         data.min_area = 100;
%     case '0109_neg78',
%         data.path = strcat(root,'0109_2015/negative_tile/');
%         data.file = 'cp_neg_crop78.png';
%         data.intensity_th = 170;
%         data.min_area = 100;
%         
% end;
return;